package models


import scala.collection.mutable.Set

/**
 * 用户类model
 * Created by zzb on 15-9-21.
 */
case class User(id: Int,
                name: String,
                password: String,
                description: String)

object User {
  val users = Set(
    User(1, "zzb", "123456", "this is me"),
    User(2, "zzb2", "223456", "this is me too")
  )

  def findAll = users.toList.sortBy(_.id)

  def findById(id: Int) = users.find(_.id == id)

  def create(user: User) = users += user

}
